#ifndef __CMD_PROCESS_H__
#define __CMD_PROCESS_H__

#include "cJSON.h"
#include <stdio.h>

// BLE音频流输入
#define BLE_AUDIO_BUFFER_SIZE (100 * 1024) // 缓冲区大小，调整为适合的大小
#define BLE_PACKET_MAX_LEN 512
typedef struct {
    uint8_t *buffer; // 缓冲区本身
    int write_index; // 写指针
    int size;        // 缓冲区的当前有效数据量
} ble_ringbuffer_t;

void cmd_process_init(void);

char *cmd_setWiFi(cJSON *root);
char *cmd_setBT(cJSON *root);
char *cmd_setBLE(cJSON *root);
char *cmd_setVol(cJSON *root);
char *cmd_takePic(cJSON *root);
char *cmd_setRecord(cJSON *root);
char *cmd_setRecognize(cJSON *root);
char *cmd_setHttpServer(cJSON *root);
char *cmd_otaFirmware(cJSON *root);

char *getDevInfo(cJSON *root);
char *getBaseInfo(cJSON *root);
char *getWiFiInfo(cJSON *root);
char *getBTInfo(cJSON *root);
char *getBLEInfo(cJSON *root);

char *cmd_handler(char *data, int data_len);
void recv_file_handler(uint8_t *data, int data_len);

void local_audio_setPath(char *path);

#endif // __CMD_PROCESS_H__